package com.ynny.chapter05.controller;

import com.github.pagehelper.PageInfo;
import com.ynny.chapter05.service.UserService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

    @Resource
    UserService userService;

    @GetMapping("page/{pageNum}/{pageSize}")
    public PageInfo page(@PathVariable("pageNum") Integer pageNum,
                         @PathVariable("pageSize") Integer pageSize){

        return userService.page(pageNum , pageSize);
    }
}
